package com.example.dingdong.daomain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 
 * @ClassName: MenuEntity
 * @Description: 
 * @Author :chengwenixng
 * @DateTime 2022-03-24 22:42:59
 */
@Entity
@Table(name ="menu_entity")
public class MenuEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	/**
	 * 数据库自增长ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	/**
	 * 删除标识
	 */
	private boolean delFlag = true;
	/**
	 * 菜品名称
	 */
	private String menuName;
	/**
	 * 菜品分类(1、true:素菜;2、false:荤菜)
	 */
	private Boolean dshclassification = true;
	/**
	 * 菜品出售(1、true:出售中;2、false:无食材)
	 */
	private Boolean isSticky = true;
	/**
	 * 菜品推荐(1、true:推荐;2、false:不推荐)
	 */
	private Boolean isRecommend = false;
	/**
	 * 加入购物车数量
	 */
	private Long catNumber;
	/**
	 * 是否加入购物车
	 */
	private  Boolean isShoppingCart = false;
	/**
	 * 菜品单价
	 */
	private double price;
	/**
	 * 总价格/(元)
	 */
	private double totalPrice;
	/**
	 * 菜品图片
	 */
	private String photoPath;
	/**
	 * 菜品详情
	 */
	private String dishDetails;
	/**
	 * 创建时间
	 */
	private Date ceckingInTime = new Date();
	
	/**
	 * 菜品-用户（多对一）
	 */
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private BasicUserEntity basicUserEntity; 
	
	/**
	 * 订单-菜品（一对多）
	 */
	@JSONField(serialize = false)
	@OneToMany(mappedBy = "menuEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<OrderRecordEntity> orderRecordEntity = new ArrayList<>();
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public boolean isDelFlag() {
		return delFlag;
	}
	public Long getCatNumber() {
		return catNumber;
	}

	public void setCatNumber(Long catNumber) {
		this.catNumber = catNumber;
	}

	public Boolean getIsShoppingCart() {
		return isShoppingCart;
	}

	public double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public void setIsShoppingCart(Boolean isShoppingCart) {
		this.isShoppingCart = isShoppingCart;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}
	public Boolean getDshclassification() {
		return dshclassification;
	}

	public void setDshclassification(Boolean dshclassification) {
		this.dshclassification = dshclassification;
	}
	
	public String getPhotoPath() {
		return photoPath;
	}

	public void setPhotoPath(String photoPath) {
		this.photoPath = photoPath;
	}

	public Boolean getIsSticky() {
		return isSticky;
	}

	public void setIsSticky(Boolean isSticky) {
		this.isSticky = isSticky;
	}

	public Boolean getIsRecommend() {
		return isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getDishDetails() {
		return dishDetails;
	}

	public void setDishDetails(String dishDetails) {
		this.dishDetails = dishDetails;
	}

	public Date getCeckingInTime() {
		return ceckingInTime;
	}

	public void setCeckingInTime(Date ceckingInTime) {
		this.ceckingInTime = ceckingInTime;
	}

	public BasicUserEntity getBasicUserEntity() {
		return basicUserEntity;
	}

	public void setBasicUserEntity(BasicUserEntity basicUserEntity) {
		this.basicUserEntity = basicUserEntity;
	}

	

	public List<OrderRecordEntity> getOrderRecordEntity() {
		return orderRecordEntity;
	}

	public void setOrderRecordEntity(List<OrderRecordEntity> orderRecordEntity) {
		this.orderRecordEntity = orderRecordEntity;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
